package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.dto.DishDTO;
import com.sky.dto.DishPageQueryDTO;
import com.sky.entity.Dish;
import com.sky.vo.DishVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishMapper {
    @Select("SELECT count(id) FROM dish WHERE category_id = #{categoryId}")
    Integer countByCategory(Long categoryId);

    Page<DishDTO> queryDishPage(DishPageQueryDTO dishPageQueryDTO);

    DishVO queryDishById(long id);

    Long insetDish(Dish dto);


    void deletDishByIds(List<Long> ids);

    void upDateDish(Dish dish);

    List<Dish> list(Dish dish);
}
